﻿using MediatR;
using T.Basic.API.Appliction.Command.OutsourcedUnitsCommand;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.API.Appliction.CommandHandlers.OutsourcedUnitsHanders
{
    /// <summary>
    /// 修改外协单位信息
    /// </summary>
    public class OutsourcedUnitsUpdateCommandHander : IRequestHandler<OutsourcedUnitsUpdateCommand, int>
    {
        private readonly IOutsourcedUnitsRepository _outsourcedUnitsRepository;
        public OutsourcedUnitsUpdateCommandHander(IOutsourcedUnitsRepository outsourcedUnitsRepository)
        {
            _outsourcedUnitsRepository = outsourcedUnitsRepository;
        }
        public async Task<int> Handle(OutsourcedUnitsUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _outsourcedUnitsRepository.UpdateAsync(request);
        }
    }
}
